home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / library / locator.lha / locator / example / Locator_Example.bb2 next >
Text File  |  1996-01-10  |  1KB  |  68 lines

  1. ;/*
  2. ;** This is a LOCATOR LIBRARY EXAMPLE
  3. ;**
  4. ;** Please, copy File Locator/Example/Locator.catalog To Ram:
  5. ;**
  6. ;** If the File is missgin, message will be in Italian! ;)
  7. ;**
  8. ;** This code is (C)Copyright 1996 Fabio Rotondo AND it is
  9. ;** placed in the Public Domain.
  10. ;**
  11. ;*/
  12.  
  13. ;/* These conts were generated by LocConv ;) */
  14. #MSG_ABOUT = 0
  15. #MSG_MOMMY = 1
  16. #MSG_HIEVERYBODY = 2
  17. #MSG_COPYRIGHT = 3
  18.  
  19. Statement error{a$}
  20.   NPrint "*** ERROR: Could not open "+Chr$(34)+a$+Chr$(34)
  21. End Statement
  22.  
  23. Function.s Loc_Msg{*hand.l, num.w, def$}
  24.   SHARED loclibinit
  25.  
  26.   If *hand
  27.     *b.l = Loc_Message_(*hand, num, def$)
  28.     a$=Peek$(*b)
  29.   Else
  30.     a$ = def$
  31.   EndIf
  32.  
  33.   Function Return a$
  34. End Function
  35.  
  36. .MainPrg
  37.   *h.l = 0
  38.   If Loc_Init_()
  39.     *h=Loc_AllocHandler_()
  40.     If *h
  41.       If Loc_Open_(*h,"Ram:Locator.catalog")
  42.         error{"Ram:Locator.catalog"}
  43.         NPrint "Messages will be in Italian!"
  44.         NPrint ""
  45.       EndIf
  46.  
  47.       NPrint "About Msg:" +  Loc_Msg{*h, MSG_ABOUT, "Locator Library e' scritta da Fabio Rotondo."}
  48.       NPrint "MOMMY Msg:"+Loc_Msg{*h, MSG_MOMMY, "Ciao Mamma!"}
  49.       NPrint "Hi Everybody Msg:" +  Loc_Msg{*h, MSG_HIEVERYBODY, "Ciao a Tutti!"}
  50.       NPrint "Copyright Msg:"+Loc_Msg{*h, MSG_COPYRIGHT, "Copyright di Fabio Rotondo"}
  51.  
  52.       Loc_Close_ *h
  53.       Loc_FreeHandler_ *h
  54.     Else
  55.       error{"Handler"}
  56.     EndIf
  57.     Loc_Dispose_
  58.   Else
  59.     error{"Loc_Init()"}
  60.   EndIf
  61.  
  62.  
  63.   MouseWait
  64.   End
  65.  
  66.  
  67.  
  68.